










function UI_action(evt){
	switch(evt.target.id){
		case "PRCFileResourceList":
			prefHelper=new prefUtility();
			if(prcFile.XULlist.elementTree.currentIndex>=0) document.getElementById("editFieldString").value=prcFile.readEntry(prcFile.XULlist.elementTree.currentIndex,prefHelper.get(constants.paths.prefs.view));
			break;
		case "load":
			prcFile.load();
			
			prcFile.XULProperties.elementInputList[0].value=prcFile.prcInfo["name"];
			prcFile.XULProperties.elementInputList[1].value=prcFile.prcInfo["flags"];
			prcFile.XULProperties.elementInputList[2].value=prcFile.prcInfo["version"];
			macTimeUtilityInstance=new macTimeUtility();
			prcFile.XULProperties.elementInputList[3].value=macTimeUtilityInstance.toString(prcFile.prcInfo["timecreate"]);
			prcFile.XULProperties.elementInputList[4].value=macTimeUtilityInstance.toString(prcFile.prcInfo["timemod"]);
			prcFile.XULProperties.elementInputList[5].value=macTimeUtilityInstance.toString(prcFile.prcInfo["timebackup"]);
			prcFile.XULProperties.elementInputList[6].value=prcFile.prcInfo["appinfo"];
			prcFile.XULProperties.elementInputList[7].value=prcFile.prcInfo["sortinfo"];
			prcFile.XULProperties.elementInputList[8].value=prcFile.prcInfo["type"];
			prcFile.XULProperties.elementInputList[9].value=prcFile.prcInfo["creator"];
			prcFile.XULProperties.elementInputList[10].value=prcFile.prcInfo["idseed"];
			prcFile.XULProperties.elementInputList[11].value=prcFile.prcInfo["nextreclist"];
			prcFile.XULProperties.elementInputList[12].value=prcFile.prcInfo["numrecs"];
			break;
		case "revert":
			prcFile.load(prcFile.prcFileName);
			prcFile.XULProperties.elementInputList[0].value=prcFile.prcInfo["name"];
			prcFile.XULProperties.elementInputList[1].value=prcFile.prcInfo["flags"];
			prcFile.XULProperties.elementInputList[2].value=prcFile.prcInfo["version"];
			macTimeUtilityInstance=new macTimeUtility();
			prcFile.XULProperties.elementInputList[3].value=macTimeUtilityInstance.toString(prcFile.prcInfo["timecreate"]);
			prcFile.XULProperties.elementInputList[4].value=macTimeUtilityInstance.toString(prcFile.prcInfo["timemod"]);
			prcFile.XULProperties.elementInputList[5].value=macTimeUtilityInstance.toString(prcFile.prcInfo["timebackup"]);
			prcFile.XULProperties.elementInputList[6].value=prcFile.prcInfo["appinfo"];
			prcFile.XULProperties.elementInputList[7].value=prcFile.prcInfo["sortinfo"];
			prcFile.XULProperties.elementInputList[8].value=prcFile.prcInfo["type"];
			prcFile.XULProperties.elementInputList[9].value=prcFile.prcInfo["creator"];
			prcFile.XULProperties.elementInputList[10].value=prcFile.prcInfo["idseed"];
			prcFile.XULProperties.elementInputList[11].value=prcFile.prcInfo["nextreclist"];
			prcFile.XULProperties.elementInputList[12].value=prcFile.prcInfo["numrecs"];
			break;
		case "blockedit":
			prefHelper=new prefUtility();
			prefHelper.set(constants.paths.prefs.view,0);
			if(prcFile.XULlist.elementTree.currentIndex>=0) document.getElementById("editFieldString").value=prcFile.readEntry(prcFile.XULlist.elementTree.currentIndex,prefHelper.get(constants.paths.prefs.view));
			break;
		case "hexedit":
			prefHelper=new prefUtility();
			prefHelper.set(constants.paths.prefs.view,2);
			if(prcFile.XULlist.elementTree.currentIndex>=0) document.getElementById("editFieldString").value=prcFile.readEntry(prcFile.XULlist.elementTree.currentIndex,prefHelper.get(constants.paths.prefs.view));
			break;
		case "stringedit":
			prefHelper=new prefUtility();
			prefHelper.set(constants.paths.prefs.view,1);
			if(prcFile.XULlist.elementTree.currentIndex>=0) document.getElementById("editFieldString").value=prcFile.readEntry(prcFile.XULlist.elementTree.currentIndex,prefHelper.get(constants.paths.prefs.view));
			break;
		case "help_internalEditor":
			window.openDialog ( constants.paths.help.editorInternal , constants.strings.UI.editorInternalTitle , "centerscreen,dependent,height=400,width=600" );
			break;
		default:
			break;
	}
}

function init(){
	prcFile=new palmResourceContainer();
	prcFile.setup();
}